crane Verified current stable Not installed? Containers

Crane / Push Image With Published References From File

Push Image With Published References From File

Push an image with published references from a specified file using the crane tool.

$
Terminal
crane push <path/to/tarball> <image_name> --image-refs <path/to/file>

When To Use

During deployment when precise image references must be maintained across environments.

Pro Tip

Utilize the `--no-push` flag to validate references without pushing to the registry; this helps catch ref errors early.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
crane push <path/to/tarball> <image_name> --image-refs <path/to/file>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Pushing image with published references...

  Image Name         |  Status      
---------------------|--------------
  my-app:latest      |  Pushed      
  my-app:v1          |  Pushed      

Successfully pushed images with references from file.

Anatomy of Output

Understanding the result

Pushing image myapp/image Image Name

Identifier for the image being pushed.

Published references: 5 Reference Count

Indicates the number of published references processed.

Success: Image pushed to registry Execution Status

Indicates completion of push operation.

Troubleshooting

Common pitfalls

failed to push image: unauthorized: authentication required

Solution: Check registry credentials and retry using `docker login`.

error parsing reference: "invalid/name:tag"

Solution: Verify the image name format; ensure it follows the 'repository/image:tag' convention.

unable to read file: /path/to/file: no such file or directory

Solution: Confirm the path to the references file and ensure it exists.

Command Breakdown

What each part is doing

crane
Base Command
The executable that performs this operation. Here it runs Crane before the shell applies any redirect operators.
<path/to/tarball>
path to tarball
The value supplied for path to tarball.
<image_name>
image name
The value supplied for image name.
<path/to/file>
Input Files
The file path or paths supplied to this command.
--image-refs
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run the command: `crane push {{path/to/tarball}} {{image_name}} --image-refs {{path/to/file}}`

  2. Step 2

    Check the output for the message 'Successfully pushed images with references from file'.

Alternative Approaches

Comparable commands in other tools

Alternative containers tools for the same job.